stu_id =[10001,10002,10003,10004,10001,10001]
names = ["Mike","Mary","Jan","Jack"]

# 列表的私有方法
# 1.增加的方法
## 1.1 增加append() 增加在list的末尾
# names.append(1)
#print(names)

## 1.2 插入insert()可以指定位置增加元素
# names.insert(1,'yougege')
#print(names)

## 2 删除remove 和pop
##
## 2.1 一般情况下 使用remove先用in做判断
#if 1 in names:
#    names.remove(1)

# 2.2 pop() 删除位置为1的这个元素
names.pop(1)
#print("pop()方法后的names:",names)
#print(names)



## 3.index()索引 查看该元素如10001在stu_id中第一个出现的位置索引
print(stu_id.index(10001))

## 4.clear()清除所有数据
#names.clear()
#print("清除names列表后的值:,names)

## 5.count()查看列表元素出现的个数
print("count方法的结果:",stu_id.count(10001))
print(names)

## 6.extend() 是给指定的list进行扩充
names.extend(stu_id)
print(names)

##作业：list方法的总结

## 1. len()查看list长度
#print("name的长度/name的列表元素个数：",len(names))
#print(names)


#补充：常规序列操作

#x in s                  True if an item of s is equal to x, else False
#x not in s              False if an item of s is equal to x, else True
#s + t                   the concatenation of s and t
#s * n 或者 n * s        equivalent to adding s to itself n times
#s[i]                    ith item of s, origin 0
#s[i:j]                  slice of s from i to j
#s[i:j:k]                slice of s from i to j with step k
#len(s)                  length of s
#min(s)                  smallest item of s
#max(s)                  largest item of s
#s.index(x[, i[, j]])    index of the first occurrence of x in s (at or after index i and before index j)
#s.count(x)              total number of occurrences of x in s